package com.ruoyi.business.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.business.mapper.CzProcessNodeMapper;
import com.ruoyi.business.domain.CzProcessNode;
import com.ruoyi.business.service.ICzProcessNodeService;

/**
 * 流程节点Service业务层处理
 * 
 * @author ruoyi
 * @date 2022-01-01
 */
@Service
public class CzProcessNodeServiceImpl implements ICzProcessNodeService 
{
    @Autowired
    private CzProcessNodeMapper czProcessNodeMapper;

    /**
     * 查询流程节点
     * 
     * @param nodeId 流程节点主键
     * @return 流程节点
     */
    @Override
    public CzProcessNode selectCzProcessNodeByNodeId(Long nodeId)
    {
        return czProcessNodeMapper.selectCzProcessNodeByNodeId(nodeId);
    }

    /**
     * 查询流程节点列表
     * 
     * @param czProcessNode 流程节点
     * @return 流程节点
     */
    @Override
    public List<CzProcessNode> selectCzProcessNodeList(CzProcessNode czProcessNode)
    {
        return czProcessNodeMapper.selectCzProcessNodeList(czProcessNode);
    }

    /**
     * 新增流程节点
     * 
     * @param czProcessNode 流程节点
     * @return 结果
     */
    @Override
    public int insertCzProcessNode(CzProcessNode czProcessNode)
    {
        czProcessNode.setCreateTime(DateUtils.getNowDate());
        return czProcessNodeMapper.insertCzProcessNode(czProcessNode);
    }

    /**
     * 修改流程节点
     * 
     * @param czProcessNode 流程节点
     * @return 结果
     */
    @Override
    public int updateCzProcessNode(CzProcessNode czProcessNode)
    {
        czProcessNode.setUpdateTime(DateUtils.getNowDate());
        return czProcessNodeMapper.updateCzProcessNode(czProcessNode);
    }

    /**
     * 批量删除流程节点
     * 
     * @param nodeIds 需要删除的流程节点主键
     * @return 结果
     */
    @Override
    public int deleteCzProcessNodeByNodeIds(Long[] nodeIds)
    {
        return czProcessNodeMapper.deleteCzProcessNodeByNodeIds(nodeIds);
    }

    /**
     * 删除流程节点信息
     * 
     * @param nodeId 流程节点主键
     * @return 结果
     */
    @Override
    public int deleteCzProcessNodeByNodeId(Long nodeId)
    {
        return czProcessNodeMapper.deleteCzProcessNodeByNodeId(nodeId);
    }
}
